name = "箱子记忆"
description = "不打开箱子就看到物品"
author = "温如言"
version = "1.0.0"

forumthread = ""
api_version_dst = 10

priority = 0

icon_atlas = "modicon.xml"
icon = "modicon.tex"

dst_compatible = true

client_only_mod = true

local function AddConfig(name,label,hover,options,default)
    return  {
        name = name,
        label = label,
        hover = hover,
        options = options,
        default = default,
        }
end

local function AddEmptySeperator(seperator)
    return {
  name = "",
  label = seperator,
  hover = "",
  options = {
    {description = "", data = 0},
  },
  default = 0,
  
}
end

local function AddOpt(desc,data,hover)
   return {description = desc, data = data, hover = hover} 
end

local bool_opt = {
    AddOpt("启用",true),
    AddOpt("禁用",false),
}

local keys_opt = {
  AddOpt("无",0),
  AddOpt("A",97),
  AddOpt("B",98),
  AddOpt("C",99),
  AddOpt("D",100),
  AddOpt("E",101),
  AddOpt("F",102),
  AddOpt("G",103),
  AddOpt("H",104),
  AddOpt("I",105),
  AddOpt("J",106),
  AddOpt("K",107),
  AddOpt("L",108),
  AddOpt("M",109),
  AddOpt("N",110),
  AddOpt("O",111),
  AddOpt("P",112),
  AddOpt("Q",113),
  AddOpt("R",114),
  AddOpt("S",115),
  AddOpt("T",116),
  AddOpt("U",117),
  AddOpt("V",118),
  AddOpt("W",119),
  AddOpt("X",120),
  AddOpt("Y",121),
  AddOpt("Z",122),
  AddOpt("无",0),
  AddOpt("句号",46),
  AddOpt("斜线",47),
  AddOpt("分号",59),
  AddOpt("左括号",91),
  AddOpt("右括号",93),
  AddOpt("F1",282),
  AddOpt("F2",283),
  AddOpt("F3",284),
  AddOpt("F4",285),
  AddOpt("F5",286),
  AddOpt("F6",287),
  AddOpt("F7",288),
  AddOpt("F8",289),
  AddOpt("F9",290),
  AddOpt("F10",291),
  AddOpt("F11",292),
  AddOpt("F12",293),
  AddOpt("上",273),
  AddOpt("下",274),
  AddOpt("右",275),
  AddOpt("左",276),
  AddOpt("上翻页",280),
  AddOpt("下翻页",281),
  AddOpt("开始",278),
  AddOpt("插入",277),
  AddOpt("删除",127),
  AddOpt("结束",279),
  AddOpt("无",0),
}

local special_buttons = {
    AddOpt("无",0),
    AddOpt("右Shift",303),
    AddOpt("左Shift",304),
    AddOpt("右Ctrl",305),
    AddOpt("左Ctrl",306),
    AddOpt("右Alt",307),
    AddOpt("左Alt",308),
  }
  
  local widget_displaytype = {
    AddOpt("展示所有","All","显示所有箱子小部件"),
    AddOpt("悬浮显示","Single","箱子小部件仅悬停显示"),
      }
  
  local sizes = {}
  for i = 10,24 do
     sizes[i-9] = AddOpt(""..i/2,i/2)
  end
  
  local hightlight_sizes = {}
  for i = 3,20 do
      hightlight_sizes[i-2] = AddOpt(""..i/2,i/2)
  end
  
  local chest_toggle_types = {
      AddOpt("默认","default","禁用<=>启用"),
      AddOpt("所有显示类型","all_displays","禁用<=>悬停时显示<=>全部显示"),
      AddOpt("所有+隐藏","all","隐藏/禁用（特殊键）<=>悬停时显示<=>全部显示"),
  }
  

configuration_options = {
        AddConfig("highlight_onmouseover","高亮选取","鼠标滑过箱子增加小部件显示大小",bool_opt,true),
        AddConfig("default_show","默认显示","默认是否显示小部件",bool_opt,true),
        AddConfig("widget_toggle","切换显示按钮","切换小部件显隐的按钮",keys_opt,106), 
        AddConfig("widget_cycle","显示类型","切换显示规则",chest_toggle_types,"all"),
        AddConfig("highlight_activeitem","高亮活动物品","手持物品高亮显示",bool_opt,true),
        AddConfig("highlight_ingredient","高亮原料","悬浮物品箱子高亮显示",bool_opt,true),
        AddConfig("widget_displaytype","显示类型","箱子显示方式",widget_displaytype,"Single"),
        AddConfig("widget_highlightsize","高亮程度","高亮显示时小部件的大小",hightlight_sizes,3),
        AddConfig("widget_scale","部件大小","箱子小部件的大小",sizes,5),
        AddConfig("highlightpause_button","记忆按钮","滚动箱子记忆的按钮",special_buttons,308),
        AddConfig("include_icebox","冰箱记录","冰箱记录", bool_opt,true),
        AddConfig("include_saltbox","盐盒记录","盐盒记录", bool_opt,true),
    }